package com.azt.api.dto;

import com.azt.api.pojo.EnqBudget;
import com.azt.api.pojo.EnqEnquiry;

import java.math.BigDecimal;
import java.util.List;

/**
 * 预算详情包装类
 * Created by 张栋 on 2016/9/2013:42
 */
public class EnqBudgetDetailWrap {

    /**
     * 基本信息
     * 里面会关联表EnqProject
     * 从中获取enqProjectName
     */
    private EnqEnquiry  enqEnquiry;

    private EnqBudget enqBudget;

    /**
     * 详情列表
     */
    private List<EnqQuoteItemExt> detailList;

    /**
     * 所有供应商的信息
     */
    private List<EnqBgetCompInfo> companys;




    /*获取列表总价*/
    public  Double  getTotalPrice(){
        BigDecimal total = new BigDecimal(0);
        for (EnqQuoteItemExt enqQuoteItemExt : detailList) {
            BigDecimal totalPrice = new BigDecimal(enqQuoteItemExt.getTotalPrice());
            total = total.add(totalPrice);
        }
        return total.doubleValue();
    }



    public List<EnqQuoteItemExt> getDetailList() {
        return detailList;
    }

    public void setDetailList(List<EnqQuoteItemExt> detailList) {
        this.detailList = detailList;
    }

    public List<EnqBgetCompInfo> getCompanys() {
        return companys;
    }

    public void setCompanys(List<EnqBgetCompInfo> companys) {
        this.companys = companys;
    }

    public EnqEnquiry getEnqEnquiry() {
        return enqEnquiry;
    }

    public void setEnqEnquiry(EnqEnquiry enqEnquiry) {
        this.enqEnquiry = enqEnquiry;
    }

    public EnqBudget getEnqBudget() {
        return enqBudget;
    }

    public void setEnqBudget(EnqBudget enqBudget) {
        this.enqBudget = enqBudget;
    }
}
